<!DOCTYPE html>
<html lang="zh-CN">
  <head><meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">

<meta name="description" content="Linux常用指令"/><link rel="alternate" href="/default" title="Hexo" ><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=2.11.1" />
<link rel="canonical" href="https://y_kvm.gitee.io/2022/02/21/Linux常用指令/"/>

<link rel="stylesheet" type="text/css" href="/lib/fancybox/jquery.fancybox.css" /><script type="text/x-mathjax-config">
    MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });
  </script>
  <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<link rel="stylesheet" type="text/css" href="/css/style.css?v=2.11.1" />

<script id="baidu_analytics">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?9c3376609b4eb87c460cc9503d43f10e";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script><script src="//cdn1.lncld.net/static/js/3.1.1/av-min.js"></script>
  <script id="leancloud">
    AV.init({
      appId: "mhfJYrvbNrJ7wa3pFNWptaoe-MdYXbMMI",
      appKey: "IDppcTL9Rek0zfezfOeuICaF"
    });
  </script><script>
  window.config = {"leancloud":{"app_id":"mhfJYrvbNrJ7wa3pFNWptaoe-MdYXbMMI","app_key":"IDppcTL9Rek0zfezfOeuICaF"},"toc":true,"fancybox":true,"pjax":"","latex":true};
</script>

    <title>Linux常用指令 - Hexo</title>
  <meta name="generator" content="Hexo 5.4.1"></head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/." class="logo">Hexo</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list"><a href="/">
        <li class="mobile-menu-item">首页
          </li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">标签
          </li>
      </a><a href="/about/">
        <li class="mobile-menu-item">关于
          </li>
      </a></ul>
</nav>
<div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/." class="logo">Hexo</a>
</div>

<nav class="site-navbar"><ul id="menu" class="menu"><li class="menu-item">
          <a class="menu-item-link" href="/">
            首页
            </a>
        </li>
      <li class="menu-item">
          <a class="menu-item-link" href="/tags/">
            标签
            </a>
        </li>
      <li class="menu-item">
          <a class="menu-item-link" href="/about/">
            关于
            </a>
        </li>
      </ul></nav>
</header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content"><article class="post">
    <header class="post-header">
      <h1 class="post-title">Linux常用指令
        </h1>

      <div class="post-meta">
        <span class="post-time">
          2022-02-21
        </span><span class="post-visits"
             data-url="/2022/02/21/Linux%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4/"
             data-title="Linux常用指令">
          阅读次数 0
        </span>
        </div>
    </header>

    <div class="post-toc" id="post-toc">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%BF%AB%E6%8D%B7%E6%8C%87%E4%BB%A4"><span class="toc-text">快捷指令</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BB%BA%E7%AB%8B%E6%96%87%E4%BB%B6%E5%A4%B9%E9%97%B4%E7%9A%84%E6%98%A0%E5%B0%84"><span class="toc-text">建立文件夹间的映射</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BB%BA%E7%AB%8B%E6%96%87%E4%BB%B6%E9%97%B4%E7%9A%84%E6%98%A0%E5%B0%84"><span class="toc-text">建立文件间的映射</span></a></li></ol></li></ol>
    </div>
  </div><div class="post-content"><h2 id="快捷指令"><a href="#快捷指令" class="headerlink" title="快捷指令"></a>快捷指令</h2><h3 id="建立文件夹间的映射"><a href="#建立文件夹间的映射" class="headerlink" title="建立文件夹间的映射"></a>建立文件夹间的映射</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mount --<span class="built_in">bind</span> /www/dir1 /www/xxr.so/dir2</span><br></pre></td></tr></table></figure>

<p>建立从dir1映射到dir2的文件夹映射，完成相当于在dir2建立起关于dir1的映射在这两个文件夹中的操作均可以认为是在操作dir1。注意，dir2必须是已经建立的文件夹</p>
<p>如果你操作错了，进入映射的目标路径，使用： umount ./dir2 取消就可以了。</p>
<h3 id="建立文件间的映射"><a href="#建立文件间的映射" class="headerlink" title="建立文件间的映射"></a>建立文件间的映射</h3><p>软链接</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ln</span> -s &lt;<span class="built_in">source</span>&gt; &lt;target-file&gt;</span><br></pre></td></tr></table></figure>

<p>硬链接,默认创建硬链接</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ln</span> &lt;<span class="built_in">source</span>&gt; &lt;target-file&gt;</span><br></pre></td></tr></table></figure>


      </div>
      <div class="post-copyright">
    <p class="copyright-item">
      <span>原文作者: </span>
      <a href="https://y_kvm.gitee.io">Explorer</a>
    </p>
    <p class="copyright-item">
      <span>原文链接: </span>
      <a href="https://y_kvm.gitee.io/2022/02/21/Linux%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4/">https://y_kvm.gitee.io/2022/02/21/Linux%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4/</a>
    </p>
    <p class="copyright-item">
      <span>许可协议: </span><a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>
    </p>
  </div>
      <footer class="post-footer">
        
        <nav class="post-nav"><a class="next" href="/2022/02/21/ARM%20%20%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/">
        <span class="next-text nav-default">ARM  环境配置</span>
        <span class="prev-text nav-mobile">下一篇</span>
        <i class="iconfont icon-right"></i>
      </a>
    </nav></footer>
    </article></div><div class="comments" id="comments"></div></div>
      </main>

      <footer id="footer" class="footer"><div class="social-links"><a href="mailto:alternatingcurrenttesla@outlook.com" class="iconfont icon-email" title="email"></a>
        <a target="_blank" rel="noopener" href="https://github.com/KVM-Explorer" class="iconfont icon-github" title="github"></a>
        <a href="/atom.xml" class="iconfont icon-rss" title="rss"></a>
    </div><div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" target="_blank" rel="noopener" href="https://github.com/ahonn/hexo-theme-even">Even</a>
  </span>

  <span class="copyright-year">&copy;2015 - 2022<span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">Explorer</span>
  </span>
</div>
</footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div><script type="text/javascript" src="/lib/jquery/jquery.min.js"></script>
  <script type="text/javascript" src="/lib/slideout/slideout.js"></script>
  <script type="text/javascript" src="/lib/fancybox/jquery.fancybox.pack.js"></script>
  <script type="text/javascript" src="/js/src/even.js?v=2.11.1"></script>
</body>
</html>
